package com.example.myapplication.vm.adpter

import android.graphics.drawable.Drawable
import android.widget.ImageView
import androidx.annotation.NonNull
import androidx.databinding.BindingAdapter
import com.bumptech.glide.Glide

/**
 * Created by Lzz on 9/20/2020.
 */
class ImageViewAdapter {

    companion object{
        @JvmStatic
        @BindingAdapter("app:imageUrl","app:error")
        fun loadImage(img:ImageView, url:String,error:Drawable){
            Glide.with(img.context)
                .load(url)
                .error(error)
                .into(img)
        }

    }

}